package com.sumainfor.pc.market.controller.epc;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.service.TcmktHousingSysUserIdService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * <p>
 * 根据房源编号查询管家编号
 * <p>
 *
 * @author: zhoucong
 * @create: 2019-07-02 11:36
 **/
@Controller
@RequestMapping("/key/TcmktHousingSysUserId")
public class TcmktHousingSysUserIdController {

    @Autowired
    TcmktHousingSysUserIdService tcmktHousingSysUserIdService;

    /**
     * 根据房源编号查询管家编号
     *
     * @return
     * @author zhoucong
     * @data 2019/7/2
     * @Param
     */
    @ResponseBody
    @PostMapping("/getTcmktHousSysUserId")
    public JsonResult getTcmktHousSysUserId(@RequestBody Map<String, Object> params) {

        return tcmktHousingSysUserIdService.getTcmktHousSysUserId(params);
    }

    /**
     * 获取签约公司编号
     *
     * @param houId
     * @return
     */
    @ResponseBody
    @PostMapping("/getCorId")
    public JsonResult getCorId(String houId) {
        if (StringUtils.isBlank(houId)) {
            return JsonResult.errorForEmpty();
        }
        return JsonResult.success(tcmktHousingSysUserIdService.getCorId(houId));
    }
}
